package com.mano.mall.service.pay.impl;

import com.mano.mall.api.dto.pay.output.PaymentChannelDTO;
import com.mano.mall.api.pay.PaymentChannelService;
import com.mano.mall.common.base.BaseApiService;
import com.mano.mall.common.base.BaseResponse;
import com.mano.mall.common.mapper.MapperUtils;
import com.mano.mall.service.mapper.PaymentChannelMapper;
import com.mano.mall.service.mapper.entity.PaymentChannelEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class PaymentChannelServiceImpl extends BaseApiService<List<PaymentChannelDTO>>
		implements PaymentChannelService {
	@Autowired
	private PaymentChannelMapper paymentChannelMapper;

	@Override
	public BaseResponse<List<PaymentChannelDTO>> selectAll() {
		List<PaymentChannelEntity> paymentChanneList = paymentChannelMapper.selectAll();
		// Mapper 映射 List  DTO
		List<PaymentChannelDTO> paymentChannelDTOS = MapperUtils.mapAsList(paymentChanneList, PaymentChannelDTO.class);
		return setResultSuccess(paymentChannelDTOS);
	}

}
